package com.nolydake.swingnote.util;

import java.util.UUID;

public class StringUtil {

    public static String randomUUID() {
        return UUID.randomUUID().toString().replace("-", "");
    }

    public static String join(String[] array, char separator) {

        if (array == null) {
            return null;
        }

        StringBuffer buf = new StringBuffer();

        for (int i = 0; i < array.length; i++) {

            buf.append(separator);

            if (array[i] != null) {
                buf.append(array[i]);
            }
        }

        return buf.toString();
    }
}
